<template>
	<view class="roomdetailcontainer" v-show="show">
		<u-swiper :list="dataAll.images_text" height="300" radius="0"></u-swiper>
		<!-- <image class="titleimg" src="../../static/images/hotel/roomdetailimg.png"></image> -->
		 <view class="maincontainer">
				<view class="dianname">{{dataAll.name}}</view>
				<view class="flexbetween flex_wrap">
					<view class="item roominfo flexcenter" v-for="item in dataAll.attr_text" :key="item">
						<view class="itemtop">{{item[0]}}</view>
						<view class="itembottom">{{item[1]}}</view>
					</view>
				</view>
			</view>
	     <view class="roomsheshi">
			   <view class="title">房屋设施</view>
			   <view class="content cfont">
				  <u-parse :content="dataAll.service_content"></u-parse>
			   </view>
			   <view class="title" style="margin-top: 50rpx;">退订政策</view>
			   <view class="content cfont" style="line-height: 36rpx;">
				  <u-parse :content="dataAll.return_zc"></u-parse>
			   </view>
			   <view class="title" style="margin-top: 50rpx;">入住须知</view>
			   <view class="content cfont">
				  <u-parse :content="dataAll.rz_xz"></u-parse>
			   </view>
		   </view>
	    <view class="bottomsubmitbtn flexbetween">
			<view class="price">￥{{dataAll.salesprice}}</view>
	       <view class="submitcontext" @click="goYuDing(listid)">立即预订</view> 
	    </view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				start:"",
				end:"",
				startime: "", //开始时间
				endtime: "", //结束时间
				startweek: "", //开始周
				endweek: "", //结束周
				daynum: 1,
				listid:"",
				dataAll:{},
				
				show:false,
			};
		},
		onLoad(options) {
			let data = JSON.parse(decodeURIComponent(options.msg));
			this.listid = data.id
			this.start = data.start
			this.end = data.end
			this.startime = data.startime
			this.endtime = data.endtime
			this.startweek = data.startweek
			this.endweek = data.endweek
			this.daynum = data.daynum
			this.init()
		},
		methods:{
			init() {
				httpRequest.request('api/shop/houseDetail', 'GET', {
					id: this.listid
				}, false, false, false).then(res => {
					this.show=true
					res.data.attr_text = Object.entries(res.data.attr_text);
					console.log(res.data.attr_text,"惊雷")
					this.dataAll = res.data
				}).catch(err => {
					this.show=true
					httpRequest.toast(err.msg);
				})
			},
			goYuDing(id){
				let date = {
					id,
					start:this.start,
					end:this.end,
					startime: this.startime, //开始时间
					endtime: this.endtime, //结束时间
					startweek: this.startweek, //开始周
					endweek: this.endweek, //结束周
					daynum: this.daynum,
				}
				if (!httpRequest.checkIsLogin()) {
				 httpRequest.doLogin();
				 return false;
				}else{
				 uni.navigateTo({
					url: '/pages/hotel/yuding?msg=' + encodeURIComponent(JSON.stringify(date))
				 })
				} 
			}
		}
	}
</script>

<style lang="scss" scoped>
.roomdetailcontainer{
	min-height: 100vh;
	background-color:#FAFAFA;
}
.titleimg{
	width: 100vw;
	height: 569rpx;
}
.maincontainer{
	border-radius: 39rpx 39rpx 0 0;
	position: relative;
    background-color: #FFFFFF;
	top: -102rpx;
	width: 100vw;
	padding: 30rpx;
	box-sizing: border-box;
}
.dianname{
	font-size: 32rpx;
	font-family: PingFang SC-Heavy, PingFang SC;
	font-weight: 800;
	color: #000000;
	line-height: 38rpx;
	margin-bottom: 40rpx;
}
// .roominfo{
// 	margin-top: 30rpx;
// }
.item{
	width: 40%;
	padding: 0;
	margin-bottom: 30rpx;
	margin-top:0;
	text-align: left;
	display: flex;
	justify-content: flex-start;
	.itemtop{
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		// font-weight: 500;
		color: #999999;
		line-height: 26rpx;
		white-space: nowrap;
		margin-right:20rpx;
	}
	.itembottom{
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		// font-weight: 500;
		color: #000000;
		line-height: 26rpx;
		white-space: nowrap;
	}
}
// .item{
// 	padding: 10rpx 25rpx;
// 	margin-right: 20rpx;
// 	border-radius: 14rpx;
// 	border: 1rpx solid #00D2E1;
// 	.itemtop{
// 		font-size: 22rpx;
// 		font-family: PingFang SC-Medium, PingFang SC;
// 		font-weight: 500;
// 		color: #999999;
// 		line-height: 26rpx;
// 		white-space: nowrap;
// 	}
// 	.itembottom{
// 		margin-top: 8rpx;
// 		font-size: 22rpx;
// 		font-family: PingFang SC-Medium, PingFang SC;
// 		font-weight: 500;
// 		color: #000000;
// 		line-height: 26rpx;
// 		white-space: nowrap;
// 	}
// }
.roomsheshi{
	margin-top: -60rpx;
	padding: 30rpx;
	padding-bottom: 200rpx;
	background-color: #FFFFFF;
	.title{
		font-size: 28rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #000000;
		line-height: 30rpx;
	}
	.content{
		margin-top: 30rpx;
	}
}
.cfont{
	font-size: 26rpx;
	font-family: PingFang SC-Medium, PingFang SC;
	// font-weight: 500;
	line-height: 28rpx;
	color: #666666;
}
.subtitle{
	color: #00D2E1;
	padding: 5rpx 0;
}
.contenttxt{
	color:#333333;
	
	padding: 5rpx 0;
}
.subtitle1{
	color:#FF5C00;
	padding: 5rpx 0;
}
.zhengce{
	margin-top: 30rpx;
}
.bottomsubmitbtn{
		position: fixed;
		width: 100%;
		bottom: 0rpx;
		left: 0rpx;
		padding:30rpx;
		background-color: #FFFFFF;
		box-sizing: border-box;
		line-height: 100%;
		.price{
			font-size: 36rpx;
			font-family: PingFang SC-Heavy, PingFang SC;
			font-weight: 800;
			color: #FF5C00;
			line-height: 28rpx;
		}
		.submitcontext{
			border-radius: 120rpx;
			background-color: #FF5C00;
			padding: 2rpx 84rpx;
			font-size: 32rpx;
			font-family: PingFang SC-Heavy, PingFang SC;
			font-weight: 800;
			color: #FFFFFF;
			line-height: 80rpx;
		}
}
</style>
